package me.softwareengineer.guice.rendering.listener;

import java.util.Map;

import me.softwareengineer.guice.rendering.domain.DOM;
import me.softwareengineer.guice.rendering.domain.HeaderElement;
import me.softwareengineer.guice.rendering.domain.HeaderLevel;

/**
 * Called to notify about a new section header found in the {@link DOM} tree.
 * 
 * 
 * <pre>
 * This class is thread-safe and immutable.
 * </pre>
 * 
 * @author yadtahir
 * @since 1.0
 * @see EndHeaderEvent
 * @see HeaderElement
 * @see StartElementEvent
 */
public final class StartHeaderEvent extends EventHasProperties implements
		StartElementEvent {
	/**
	 * Holds the level of the header
	 */
	private HeaderLevel headerLevel;

	/**
	 * Creates a start header event
	 * 
	 * @param properties
	 *            the properties of the header element
	 * @param headerLevel
	 *            the level of the header element. For more information, please
	 *            check {@link HeaderLevel}
	 */
	public StartHeaderEvent(HeaderLevel headerLevel,
			Map<String, String> properties) {
		super(properties);
		this.headerLevel = headerLevel;
	}

	/**
	 * 
	 * @return the level of the header. For more information, see
	 *         {@link HeaderLevel}
	 */
	public HeaderLevel getHeaderLevel() {
		return headerLevel;
	}

}
